package service

import (
	"context"
	"ruoyi-go-echo-ddd/internal/domain/model"
	"ruoyi-go-echo-ddd/internal/domain/repository"
	"ruoyi-go-echo-ddd/internal/infrastructure/http/request"
)

// SysMenuResourcesService 系统菜单资源服务接口
type SysMenuResourcesService struct {
	Repo repository.SysMenuResourcesRepo
}

func NewSysMenuResourcesService(repo repository.SysMenuResourcesRepo) *SysMenuResourcesService {
	return &SysMenuResourcesService{Repo: repo}
}

func (s *SysMenuResourcesService) Insert(ctx context.Context, sysMenuResources *model.SysMenuResources) (*model.SysMenuResources, error) {
	return s.Repo.Insert(ctx, sysMenuResources)
}

func (s *SysMenuResourcesService) Update(ctx context.Context, sysMenuResources *model.SysMenuResources) (int64, error) {
	return s.Repo.Update(ctx, sysMenuResources)
}

func (s *SysMenuResourcesService) BatchInsert(ctx context.Context, list []*model.SysMenuResources) ([]int64, error) {
	return s.Repo.BatchInsert(ctx, list)
}

func (s *SysMenuResourcesService) SelectById(ctx context.Context, id int64) (*model.SysMenuResources, error) {
	return s.Repo.SelectById(ctx, id)
}

func (s *SysMenuResourcesService) SelectPage(ctx context.Context, param *request.SysMenuResourcesReq) ([]*model.SysMenuResources, int64, int64, error) {
	return s.Repo.SelectPage(ctx, param)
}

func (s *SysMenuResourcesService) BatchDelete(ctx context.Context, ids []any) (int64, error) {
	return s.Repo.BatchDelete(ctx, ids)
}

func (s *SysMenuResourcesService) SelectAllForExcel(ctx context.Context) ([]*model.SysMenuResources, error) {
	return s.Repo.SelectAllForExcel(ctx)
}
